//
//  DetailViewController.m
//  DrillDownExample
//

#import "DetailViewController.h"

@implementation DetailViewController

@synthesize content;

- (void)viewWillAppear:(BOOL)animated {
	self.title = @"Details";
	[self.tableView reloadData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
	return [content count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	static NSString *CellIdentifier = @"Details";
	
	UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
	if (cell == nil) {
		cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
									   reuseIdentifier:CellIdentifier] autorelease];
	}
	
	cell.textLabel.text = [content objectAtIndex:indexPath.row];
	
	return cell;
}

- (void)dealloc {
	[content release];
    [super dealloc];
}

@end
